package com.cndatacom.teleweb.service.impl;

import com.cndatacom.teleweb.common.PaginationModel;
import com.cndatacom.teleweb.dao.IWorkNewsDao;
import com.cndatacom.teleweb.model.WorkNews;
import com.cndatacom.teleweb.service.IWorkNewsService;

public class WorkNewsService implements IWorkNewsService {

	private IWorkNewsDao workNewsDao;
	
	public IWorkNewsDao getWorkNewsDao() {
		return workNewsDao;
	}

	public void setWorkNewsDao(IWorkNewsDao workNewsDao) {
		this.workNewsDao = workNewsDao;
	}

	public WorkNews addWorkNews(WorkNews workNews) {
		return workNewsDao.addWorkNews(workNews);
	}

	public boolean delWorkNews(WorkNews workNews) {
		return workNewsDao.delWorkNews(workNews);
	}

	public PaginationModel getAllWorkNews(int offset, int pageSize) {
		return workNewsDao.getAllWorkNews(offset, pageSize);
	}
	
	public PaginationModel getPublishWorkNews(int offset, int pageSize) {
		return workNewsDao.getPublishWorkNews(offset, pageSize);
	}

	public WorkNews getWorkNewsById(int workId) {
		return workNewsDao.getWorkNewsById(workId);
	}

	public WorkNews updateWorkNews(WorkNews workNews) {
		return workNewsDao.updateWorkNews(workNews);
	}

	public void addClickCount(WorkNews workNews){
		  workNewsDao.addClickCount(workNews);
	}
}
